<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var arr = new Array("Tom","Jack","John");
			var obj = new Object();
			obj.name = "张三";
			obj.age = 21;
			obj.gender = "男";
			console.log("用for in遍历数组：");
			for(var index in arr){
				console.log("arr[" + index +"]= " + arr[index]);
				
			}
			console.log("用for in遍历对象：");
			for(var o in obj){
				console.log(o + "=" +obj[o]);
			}
			
		</script>
	</head>
	<body>
	</body>
</html>
